package demo2;

import java.io.File;
import java.io.IOException;

public class Main {
    public static void main(String[] args) throws IOException {
        File file = new File("file类\\src\\data.txt");
        //a.创建成功返回true,反之false
        System.out.println(file.createNewFile());
        //b.创建一级目录 mkdir
        File file1 = new File("E:/thisistest");
        System.out.println(file1.mkdir());
        File file2 = new File("E:/aaa/bbb/ccc/ddd/eee");
        //c.创建多级目录 mkdirs
        System.out.println(file2.mkdirs());
        //d.删除文件或文件夹
        System.out.println(file.delete());
        //只能删除空文件夹
    }
}
